package com.ruoyi.common.config;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

/**
 * 读取项目相关配置
 * 
 * @author ruoyi
 */
@Component
@ConfigurationProperties(prefix = "ruoyi")
public class RuoYiConfig
{
    /** 项目名称 */
    private String name;

    /** 版本 */
    private String version;

    /** 版权年份 */
    private String copyrightYear;

    /** 实例演示开关 */
    private boolean demoEnabled;

    /** 上传路径 */
    private static String profile;

    /** 获取地址开关 */
    private static boolean addressEnabled;

    /** 验证码类型 */
    private static String captchaType;

    public static String ip;
    public static String getToken;
    public static String unit;
    public static String event;
    public static String control;
    public static String task;
    public static String record;
    public static String investigation;

    public static String getIp() {
        return ip;
    }

    public static void setIp(String ip) {
        RuoYiConfig.ip = ip;
    }

    public static String getGetToken() {
        return getToken;
    }

    public static void setGetToken(String getToken) {
        RuoYiConfig.getToken = getToken;
    }

    public static String getUnit() {
        return unit;
    }

    public static void setUnit(String unit) {
        RuoYiConfig.unit = unit;
    }

    public static String getEvent() {
        return event;
    }

    public static void setEvent(String event) {
        RuoYiConfig.event = event;
    }

    public static String getControl() {
        return control;
    }

    public static void setControl(String control) {
        RuoYiConfig.control = control;
    }

    public static String getTask() {
        return task;
    }

    public static void setTask(String task) {
        RuoYiConfig.task = task;
    }

    public static String getRecord() {
        return record;
    }

    public static void setRecord(String record) {
        RuoYiConfig.record = record;
    }

    public static String getInvestigation() {
        return investigation;
    }

    public static void setInvestigation(String investigation) {
        RuoYiConfig.investigation = investigation;
    }

    private String wms;

    private String app;

    public String getApp() {
        return app;
    }

    public void setApp(String app) {
        this.app = app;
    }

    public String getWms() {
        return wms;
    }

    public void setWms(String wms) {
        this.wms = wms;
    }

    public String getName()
    {
        return name;
    }

    public void setName(String name)
    {
        this.name = name;
    }

    public String getVersion()
    {
        return version;
    }

    public void setVersion(String version)
    {
        this.version = version;
    }

    public String getCopyrightYear()
    {
        return copyrightYear;
    }

    public void setCopyrightYear(String copyrightYear)
    {
        this.copyrightYear = copyrightYear;
    }

    public boolean isDemoEnabled()
    {
        return demoEnabled;
    }

    public void setDemoEnabled(boolean demoEnabled)
    {
        this.demoEnabled = demoEnabled;
    }

    public static String getProfile()
    {
        return profile;
    }

    public void setProfile(String profile)
    {
        RuoYiConfig.profile = profile;
    }

    public static boolean isAddressEnabled()
    {
        return addressEnabled;
    }

    public void setAddressEnabled(boolean addressEnabled)
    {
        RuoYiConfig.addressEnabled = addressEnabled;
    }

    public static String getCaptchaType() {
        return captchaType;
    }

    public void setCaptchaType(String captchaType) {
        RuoYiConfig.captchaType = captchaType;
    }

    /**
     * 获取导入上传路径
     */
    public static String getImportPath()
    {
        return getProfile() + "/import";
    }

    /**
     * 获取头像上传路径
     */
    public static String getAvatarPath()
    {
        return getProfile() + "/avatar";
    }

    /**
     * 获取下载路径
     */
    public static String getDownloadPath()
    {
        return getProfile() + "/download/";
    }

    /**
     * 获取上传路径
     */
    public static String getUploadPath()
    {
        return getProfile() + "/upload";
    }
}
